package com.itdfq.loginuser.controller;

import com.alibaba.fastjson.JSON;
import com.itdfq.common.apiencry.annotition.SecurityParameter;
import com.itdfq.common.pojo.Result;
import com.itdfq.loginuser.domain.DfqUsers;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author GodChin
 * @date 2022/2/24 14:57
 * @email 909256107@qq.com
 */
@RestController
@RequestMapping("/encry")
public class EncryTestController {
    /**
     * 数据解密
     * @param user
     * @return
     */
    @RequestMapping("/encry")
    @SecurityParameter(inDecode = false)
    public Result save(@RequestBody DfqUsers user) {
        System.out.println(JSON.toJSONString(user));
        return Result.success(user);
    }

    @RequestMapping(value = "/decrypt",method = {RequestMethod.GET,RequestMethod.POST})
    @SecurityParameter(outEncode = false)
    public Result jiemi(@RequestBody Object user){

        return Result.success(user);
    }
}
